(navigation image)
Home American Libraries | Canadian Libraries | Universal Library | Community Texts | Project Gutenberg | Children's Library | Biodiversity Heritage Library | Additional Collections
Search: Advanced Search
Anonymous User (login or join us)
Upload
See other formats

Full text of "Arduino"

Arduino Mega PIR Alarm 



I 



Make Projects 



3 

build, hack, tweak, share, discover, ■ 



Arduino Mega PIR Alarm 



Written By: Ethan Flubacher 



PARTS: 



Arduino Mega (1) 
Parallax PIR sensor (1) 
8 Ohm mini speaker (1) 



SUMMARY 



Here's how to make a simple Arduino Mega PIR alarm 



© Make Projects www.makeprojects.com Page 1 of 3 



Arduino Mega PIR Alarm 





• GND to ground, V+ to pin 53, OUT 
to pin 51. 





Connect speaker to pin 41 and 
ground. 



© Make Projects 



www.makeprojects.com 



Page 2 of 3 



Arduino Mega PIR Alarm 




pirpin ■ 51; 
powerpin = 53; 

int led = 

int count ■ 6; 
int soundpin = 41; 

I ;etup() 

{ 
p i nMode (powerp i n , OU TPD T ) ; 

nMode(led, OUTPUT) 

p \ nliode (p t rp i n , IN PUT ) ; 

p inffode(soundp i n , OUTPUT) ; 

Serial ;begin(968B); 

digital Wriie(powerpin, HIGH); 



! 



delay (5000); 



void loop() 

i: 

int read in ;| 
readin = digitaLRead(plrpirt) 

if(readln == hTGH) 

taLWr itemed, HIGH); 
ia!.println("»otion*); 
■ soundpin, 1769); 
del ay (56); 

) 




Code at 
https://sites.google.com/site/projectsal 



This document was last generated on 201 2-1 1 -03 03:09:25 AM. 



© Make Projects 



www.makeprojects.com 



Page 3 of 3